


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>
	查询历史最低价
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
        <script type="text/javascript" src="/Scripts/jquery.js"></script>
        <script type="text/javascript" src="/Scripts/jquery.flot.min.js"></script>
        <script type="text/javascript" src="/Scripts/excanvas.min.js"></script>
        <script src="http://include.manmanbuy.com/js/projs/jquery.fancybox.pack.js" type="text/javascript"></script>
        <link href="http://include.manmanbuy.com/css/fancybox.css" type="text/css" rel="stylesheet" />
        <script src="Scripts/histroyTrend.js" type="text/javascript"></script>
        <script src="Scripts/chart.js" type="text/javascript"></script>
        <script type="text/javascript">

     $(document).ready(function () {
         //调用ajax
         var fontsize = "14px;";
         var divclass = "bigwidth";
         var divword = "bigwordprice";
         var disZD = true; //是否显示最低价
         var disSpname = true; //是否显示商品名称
         var show = true;
         var locationhref = window.location.href;
         var width = 950;
         var token = "";
         if (getQueryString(locationhref, "token") != "") token = getQueryString(locationhref, "token");
         if (getQueryString(locationhref, "w") != "") width = parseInt(getQueryString(locationhref, "w"));
         if (width < 400) {
             fontsize = "12px;";
             divclass = "smallwidth";
         }
         var height = 300;
         if (getQueryString(locationhref, "h") != "") height = parseInt(getQueryString(locationhref, "h"));
         var height2 = 260;
         if (getQueryString(locationhref, "h2") != "") height2 = parseInt(getQueryString(locationhref, "h2"));
         else height2 = height;
         if (getQueryString(locationhref, "zd") == "0") {
             disZD = false;
         }
         if (getQueryString(locationhref, "sp") == "0") {
             disSpname = false;
         }
         var cxid = getQueryString(locationhref, "cxid")
         var zkid = getQueryString(locationhref, "zkid")
         var url = getQueryString(locationhref, "url");
         var bjid = getQueryString(locationhref, "bjid");
         var spbh = getQueryString(locationhref, "spbh");


         //先插入 框的大小

         $("#container").html("<div style='padding-top: " + (height - 40) / 2 + "px;'>正在加载中，请稍后...</div>");
         $.ajax({
             url: "history.aspx?DA=1",
             type: 'get',
             dataType: 'json',
             data:
                                {
                                    action: 'gethistory',
                                    url: url,
                                    bjid: bjid,
                                    spbh: spbh,
                                    cxid: cxid,
                                    zkid: zkid,
                                    w: width,
                                    token: token
                                },
             success: function (json) {
                 var html = "";
                 if (json != null && json.datePrice != "没有收录" && getQueryString(locationhref, "low") != "1" || (getQueryString(locationhref, "low") == "1" && json.currentPrice<= json.lowerPrice)) {

                     if (disSpname) {
                         html += "<div style='color: #333333; font-size: 16px; margin: 10px; text-align: center; font-weight:bold;'>" + json.spName + "</div>";
                     }
                     html += "<div class='" + divclass + "' style='text-align: left; ' >";
                     html += "<span style='color: #333; font-size: " + fontsize + "'>";
                     if (width > 400) {
                         html += "<b>" + json.siteName + "</b>";
                     }
                     html += "&nbsp;<font style='font-size:12px;'> " + getTrendPrice(json.zouShi) + " &nbsp; </font>";
                     if (disZD) {
                         if (width > 400) {
                             html += "历史最低<font class='" + divword + "'>" + json.lowerPrice + "</font>";
                             html += "&nbsp;<font style='font-size: 12px;'>(" + formatDate(json.lowerDate.replace("/Date(", "").replace("-0000)/", "")) + ")</font>";
                         }
                         else {
                             html += "<div style='float:right;padding-right: 10px;'>历史最低价<font class='" + divword + "'>" + json.lowerPrice + "</font></div>";

                         }
                     }
                     if (width > 400 && json.currentPrice > 0) {
                         if (json.bjid > 0) {
                             html += "&nbsp; 当前价：" + json.currentPrice;

                         }
                         else {
                             html += " &nbsp; 当前价：" + json.currentPrice;
                         }
                     }
                     html += "</span></div>";
                     html += "</div>";



                     if (getQueryString(locationhref, "browes") == "1" && json.spName != "") {
                         addBrowes(json.spName, json.spUrl, json.currentPrice, json.spPic);
                     }
                     chart(json.datePrice, json.spUrl, "pc");
                     $("#detail").html(html);
                     $(".iframefav").fancybox({
                         'modal': true,
                         'padding': 0,
                         'showCloseButton': false,
                         'scrolling': 'no'

                     }).click(function () {
                         $("#iframemain").attr("src", "http://home.manmanbuy.com/loginIFrame.aspx?action=" + $(this).attr("v"));
                     });

                 }
                 else if (json != null && json.datePrice != "没有收录" && getQueryString(locationhref, "low") == "1" && json.currentPrice > json.lowerPrice) {
                     html = "<div style='padding-top: " + (height - 40) / 2 + "px;'>&nbsp;</div>";
                     $("#container").html(html);
                 }
                 else {

                     if (getQueryString(locationhref, "zd") != "") {
                         html = "<div style='padding-top: " + (height - 40) / 2 + "px;'>&nbsp;</div>";
                     }
                     else {
                         html = "<div style='padding-top: " + (height - 40) / 2 + "px;'>暂未收录</div>";
                     }
                     $("#container").html(html);
                 }




             },
             error: function (json) {

             }
         });
     });

     function getTrendPrice(istate) {

         var jgzs = "<span class='history-trend'>";
         switch (istate) {
             case 0: jgzs += "<i class='t-" + istate + "'></i>历史最低"; break;
             case 1: jgzs += "<i class='t-" + istate + "'></i>先涨后跌"; break;
             case 2: jgzs += "<i class='t-" + istate + "'></i>价格下降"; break;
             case 3: jgzs += "<i class='t-" + istate + "'></i>价格上涨"; break;
             case 4: jgzs += "<i class='t-" + istate + "'></i>价格平稳"; break;
             default: jgzs += "<i class='t-4'></i>价格平稳"; break;
         }
         return jgzs + "</span>";



     }
     function formatDate(now) {
         var time = new Date(parseInt(now));
         var year = time.getFullYear();
         var month = time.getMonth() + 1;
         if (month< 10) {
             month = '0' + month;
         }
         var date = time.getDate();
         if (date < 10) {
             date = '0' + date;
         }
         var hour = time.getHours();
         if (hour < 10) {
             hour = '0' + hour;
         }
         var minute = time.getMinutes();
         if (minute < 10) {
             minute = '0' + minute;
         }
         var second = time.getSeconds();
         if (second < 10) {
             second = '0' + second;
         }
         return year + "-" + month + "-" + date;
     }

     function getQueryString(sURL, key) {
         var value = '';
         if (sURL.indexOf('?') > 0) {
             var arrayParams = sURL.split('?');
             var arrayURLParams = arrayParams[1].split('&');
             for (var i = 0; i < arrayURLParams.length; i++) {
                 var sParam = arrayURLParams[i].split('=');
                 if ((sParam[0] == key) && (sParam[1] != '')) {
                     value = sParam[1];
                     break;
                 }
             }
         }
         return value;
     }
     function parentCloseWinc() {
         $.fancybox.close();
     }

    </script>
    <style type="text/css">
        body, div
        {
            border: 0px;
            margin: 0px;
            padding: 0px;
            font-size: 14px;
        }
        A.f12sc:link, A.f12sc:active, A.f12sc:visited
        {
            font-size: 12px;
            text-decoration: none;
            color: #005AA0;
        }
        .bigwidth
        {
            margin: 8px 0px 10px 0px;
            padding: 10px 0px 10px 0px;
            border-bottom: 1px solid #ccc;
            color: #ccc;
        }
        .smallwidth
        {
            color: #ccc;
        }
        .bigwordprice
        {
            color: Red;
        }
        .smallwordprice
        {
        }
        span.history-trend i{ display:inline-block; width:16px; height:14px; overflow:hidden; vertical-align:-3px; margin-right:4px;_margin:5px 4px 5px 0px;*vertical-align:0px;_vertical-align:3px;
              background:url(http://img02.taobaocdn.com/imgextra/i2/379516416/TB28Q2TcFXXXXXhXXXXXXXXXXXX_!!379516416.png) no-repeat;_background:url(http://img03.taobaocdn.com/imgextra/i3/379516416/TB2I2STXpXXXXXhXFXXXXXXXXXX_!!379516416.gif) no-repeat;}
span.history-trend i.t-3{ background-position:0px 0px;}
span.history-trend i.t-2{ background-position:-60px 0px;}
span.history-trend i.t-4{ background-position:-30px 0px;}
span.history-trend i.t-0{ background-position:-90px 0px;}
span.history-trend i.t-1{ background-position:-118px 0px;}
span.history-trend{color:#333; }
    </style>
</head>
<body>
    <div style="text-align: center; height:480px;width:600px; " id='content'>
        <div id="detail"></div>
        <div style=' height:380px;width:600px;font-size: 12px;position: relative;'>
            <div id='container' style='width: 600px; height: 380px; margin: 0 auto; font-size:12px;'></div>
        </div>
    </div>
    <div>
        <iframe id="iframemain" style=" margin:0 0; display:none;" src="http://home.manmanbuy.com/loginIFrame.aspx" width="800" height="360" rel="nofollow" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" class="iframe"></iframe>
    </div>
</body>
</html>